Object.prototype.extends=function(obj){
    for(let key in obj){
        this[key]=obj[key];
    }
    return this;
}
var Person=function(){
    this.eat=function(){ }
}
var China=function(){}
var India=function(){}

China.prototype=(new Person()).extends({
    eat:function(){
        console.log("中国用筷子");
    }
})
India.prototype=(new Person()).extends({
    eat:function(){
        console.log("印度手抓饭");
    }
})
var a=new China();
var b=new India();
a.eat();
b.eat();